package cn.wynu.controller;
import java.math.BigDecimal;

import cn.wynu.product.bean.Product;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {

    @GetMapping("/{id}")
    public Product getProduct(@PathVariable Long id) {
        Product product = new Product();
        product.setProductId(id);
        product.setProductName("苹果");
        product.setProductPrice(new BigDecimal("5"));
        product.setNum(3);

        return product;
    }
}
